package com.bysj.agent.feign;
import com.bysj.agent.config.FeignConfig;
import com.bysj.agent.utils.R;

import entity.AiPaymentOrderDto;
import entity.AiProductOrderDto;
import entity.ProductCollect;
import entity.ProductInfoDetailVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "reuse-market")
public interface UserFeignService {


//    @GetMapping("/getUsers")
//    public R getUsers();

    /**
     * 创建收藏
     * @param collect
     * @return
     */
    @PostMapping("/user/collect/create")
    public R _create(@RequestBody ProductCollect collect);

    /**
     * 获取商品详情
     * 包括商品基本信息和优惠券信息
     * @param productId 商品ID
     * @return 返回商品详细信息
     */
    @GetMapping("/product/info/detail")
    public R<ProductInfoDetailVo> _getProductInfo(@RequestParam("productId") String productId);

    /**
     * 取消收藏
     * 从当前用户的收藏列表中删除指定的收藏记录
     * @return 操作结果
     */
    @PostMapping("/user/collect/delete/")
    public R _delete(@RequestBody ProductCollect productCollect);

    /**
     * 创建订单
     * @return 订单编号
     */
    @PostMapping("/product/order/create/order")
    public R<String> aiCreateOrder(@RequestBody AiProductOrderDto dto);

    /**
     * 创建支付订单
     * @return 支付订单编号
     */
    @PostMapping("/payment/order/create")
    public R<String> aiCreatePaymentOrder(@RequestBody AiPaymentOrderDto dto);

    /**
     * 获取文档
     * @param productId
     * @return
     */
    @PostMapping("/product/info/doc")
    public String getDocById(@RequestParam("productId") String productId);

}
